﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace IURIP
{
    /// <summary>
    /// The template interface.
    /// </summary>
    public interface ITemplate
    {
        /// <summary>
        /// Gets the process template that defined in the configuration file
        /// </summary>
        IProcessTemplate ProcessTemplate { get; }
        /// <summary>
        /// Gets the innest action template that defined in the configuration file
        /// </summary>
        IActionTemplate ActionTemplate { get; }
        /// <summary>
        /// Gets the parent template that defined in the configuration file
        /// </summary>
        ITemplate ParentTemplate { get; }
        /// <summary>
        /// Gest the children template that defined in the configuration file
        /// </summary>
        LinkedList<ITemplate> ChildrenTemplates { get; }
        /// <summary>
        /// Gets the task
        /// </summary>
        ITask Task { get; }
        /// <summary>
        /// Gets the target that this template is in
        /// </summary>
        ITarget Target { get; }
        /// <summary>
        /// Gets or sets if this template has breakpoint or not.
        /// </summary>
        bool HasBreakPoint { get; set; }

        /// <summary>
        /// Create a runable instance with this template.
        /// </summary>
        /// <param name="parentRunable"></param>
        /// <returns></returns>
        IRunable CreateRunable(IRunable parentRunable);
        /// <summary>
        /// Initializes the template with the configuration file
        /// </summary>
        /// <param name="node"></param>
        void InitByConfiguration(XmlNode node);
    }
}
